﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScannerWatcher.Models
{
    public abstract class TreeNode
    {
        /// <summary>
        /// 节点Id
        /// </summary>
        public abstract string id { get; set; }

        /// <summary>
        /// 父节点Id
        /// </summary>
        public abstract string parent_id { get; set; }

        /// <summary>
        /// 节点名称
        /// </summary>
        public abstract string name { get; set; }

        /// <summary>
        /// 节点类型
        /// </summary>
        public abstract string type { get; set; }

        /// <summary>
        /// 添加时间 用于排序
        /// </summary>
        public abstract DateTime add_time { get; set; }
    }

    public class case_question_category : TreeNode
    {
        public override string id { get; set; }

        public override string parent_id { get; set; }

        public override string name { get; set; }

        public bool allow_create_question { get; set; }

        public bool allow_create_folder { get; set; }

        public bool allow_create_fact { get; set; }

        public bool allow_create_file { get; set; }

        public override string type { get; set; }

        public string case_id { get; set; }

        public override DateTime add_time { get; set; } = DateTime.Now;

        public int sort { get; set; }

        public int state { get; set; }

        public string user_id { get; set; }
        public string user_name { get; set; }

    }

    public class AddDto
    {
        public string question_id { get; set; }

        public string fact_id { get; set; }

        public string parent_id { get; set; }

        public string case_id { get; set; }

        public string file_no { get; set; }

        public string name { get; set; }

        public string file_object_name { get; set; }

        public string file_object_type { get; set; }

        public string file_type { get; set; }

        public int? file_page_size { get; set; }

        public string file_memo { get; set; }

        public string user_id { get; set; }

        public List<string> attach_person { get; set; }

        public List<FileDto> files { get; set; }

        public string available_person_ids { get; set; }

        public string available_person_names { get; set; }

        public DateTime add_time { get; set; }

        public AddDto()
        {
            files = new List<FileDto>();
            attach_person = new List<string>();
        }
    }

    public class FileDto
    {
        public string name { get; set; }

        public string url { get; set; }
    }

    public class case_question_fact_attach
    {
        public string id { get; set; }

        public string question_id { get; set; }

        public string fact_id { get; set; }

        public string case_id { get; set; }

        public string file_no { get; set; }

        public string name { get; set; }

        public string file_object_name { get; set; }

        public string file_object_type { get; set; }

        public string file_type { get; set; }

        public int? file_page_size { get; set; }

        public string file_memo { get; set; }

        public DateTime add_time { get; set; }

        public string user_id { get; set; }

        public string available_person_ids { get; set; }

        public string available_person_names { get; set; }

        public List<case_question_fact_attach_item> items { get; set; }

        public List<string> attach_person { get; set; }

        public string user_name { get; set; }

        public case_question_fact_attach()
        {
            items = new List<case_question_fact_attach_item>();
            attach_person = new List<string>();
        }
    }

    public class case_question_fact_attach_item
    {
        public string id { get; set; }

        public string attach_id { get; set; }

        public string name { get; set; }

        public string url { get; set; }

        public string size { get; set; }

        public string type { get; set; }

        public string add_user_id { get; set; }

        public DateTime add_time { get; set; }
    }
}
